import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

import 'index.dart';

class BluetoothPage extends GetView<BluetoothController> {
  const BluetoothPage({super.key});

  // 主视图
  Widget _buildView() {
    return Column(
      children: [
        TDButton(
          text: "连接",
          onTap: controller.scanBluetooth,
        )
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<BluetoothController>(
      init: BluetoothController(),
      id: "markdown",
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("Markdown")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
